﻿using SqlSugar;

namespace sixgod.Model.WorkFlow
{
    /// <summary>
    /// 流程流转记录
    /// </summary>
    [SugarTable("WorkFlowHistory_{year}{month}{day}")]
    [SplitTable(SplitType.Year)]
    public class WorkFlowHistory : ModelBase
    {
        /// <summary>
        /// 流程ID
        /// </summary>
        public string WorkFlowCode { get; set; }

        /// <summary>
        /// 连接点ID
        /// </summary>
        public string NodeLinkCode { get; set; }

        /// <summary>
        /// 处理时间
        /// </summary>
        [SplitField]
        public DateTime DisposeTime { get; set; }

        /// <summary>
        /// 模型数据验证
        /// </summary>
        /// <returns></returns>
        public override (bool, string) Verify()
        {
            return (false, null);
        }

        public void Create(string creator,string nodeLinkId,string workFlowId)
        {
            DisposeTime = DateTime.Now;
            NodeLinkCode = nodeLinkId;
            WorkFlowCode = workFlowId;
            base.Create(creator);
        }
    }
}